package com.wrupple.muba.catalogs.client.module.services.logic.impl;

import java.util.List;

import com.wrupple.muba.catalogs.client.module.services.CatalogDeletingSerializer;
import com.wrupple.muba.common.client.JSOHelper;
import com.wrupple.vegetate.domain.CatalogResponseContract;

public class CatalogDeletingSerializerImpl implements CatalogDeletingSerializer {

	@Override
	public CatalogResponseContract deserialize(String string) {
		JsCatalogResponseContract js = JSOHelper.eval(string).cast();
		return js;
	}

	@Override
	public String serialize(List<String> object) {
		if(object==null)
			return null;
		StringBuilder b = new StringBuilder(50*object.size());
		
		for(String s : object){
			b.append(s);
			b.append(',');
		}
		return b.substring(0, b.length()-1);
	}

}
